package lab02.test3;

/**
 * Created by dell on 2017/10/15.
 */
public class student {

    //属性：计算机成绩、数学成绩、英语成绩
    float computerScore;
    float matchSore;
    float englishScore;
    //行为：总分、平均分、最高分、最低分
    private float sum(){
        return computerScore+matchSore+englishScore;
    }
    private float average(){
        return (computerScore+matchSore+englishScore)/3;
    }
    private float maxScore(){
        float maxScore=computerScore>matchSore?computerScore:matchSore;
        maxScore=maxScore>englishScore?matchSore:englishScore;
        return maxScore;
    }
    private float minScore(){
        float minScore=computerScore<matchSore?computerScore:matchSore;
        minScore=minScore<englishScore?matchSore:englishScore;
        return minScore;
    }
    void printStudent(){
        System.out.println(sum());
        System.out.println(average());
        System.out.println(maxScore());
        System.out.println(minScore());
    }
}
